#ifndef MYQWTPLOT_H
#define MYQWTPLOT_H

#include "qwt_plot.h"
#include <qwt_plot.h>
#include <qwt_plot_curve.h>
#include <qwt_plot_grid.h>
#include <qwt_symbol.h>
#include <qwt_legend.h>
#include <qwt_plot_canvas.h>
#include <qwt_scale_draw.h>
#include <qwt_plot_rescaler.h>
#include <qwt_plot_panner.h>
#include <qwt_plot_magnifier.h>
#include <qwt_plot_zoomer.h>
#include <qwt_plot_marker.h>
#include <qwt_scale_widget.h>
#include <qwt_plot_layout.h>
#include <qwt_picker_machine.h>
#include <qwt_plot_renderer.h>
#include <qwt_point_data.h>

class FunctionData: public QwtSyntheticPointData
{
public:
    FunctionData( double( *y )( double ) ):
        QwtSyntheticPointData( 100 ),
        d_y( y )
    {
    }

    virtual double y( double x ) const
    {
        return d_y( x );
    }

private:
    double( *d_y )( double );
};

class MyQwtPlot : public QwtPlot
{
    Q_OBJECT
public:
    explicit MyQwtPlot(QWidget *parent = 0);
    ~MyQwtPlot();

    void RecoverXY();
private:
    QwtPlotCanvas *canvas;
    QwtPlotPicker *picker;
    QwtPlotGrid *grid;
    QwtPlotZoomer *zoomer;

public slots:
    void OnZoomer(const QRectF &rect );

};
#endif // MYQWTPLOT_H
